Skip to content

refactor!: rename Contract.root/exp_date to symbol/expiration (closes #467)#484

Merged
userFRM merged 1 commit into
mainfrom
feat/467-rename-root-symbol
May 6, 2026
Merged

refactor!: rename Contract.root/exp_date to symbol/expiration (closes #467)#484
userFRM merged 1 commit into
mainfrom
feat/467-rename-root-symbol

Conversation

@userFRM
Copy link
Copy Markdown
Owner

@userFRM userFRM commented May 6, 2026

Summary

Closes #467.

Rename the public-API fields on the SDK to match the v3 vendor surface
documented in the v2 → v3 migration guide:

Contract.root -> Contract.symbol
Contract.exp_date -> Contract.expiration
OptionContract.root -> OptionContract.symbol
FlatFileRow.root -> FlatFileRow.symbol
IndexEntry.root -> IndexEntry.symbol
IndexEntry.exp -> IndexEntry.expiration

Plus the matching constructor + parameter renames (Contract::stock(symbol),
Contract::option(symbol, expiration, ...), Contract::option_raw(...),
FlatFileRow::from_decoded(symbol, expiration, ...)).

Bumps the workspace 8.0.26 → 8.0.27 and tdbe 0.12.7 → 0.12.8 (the latter
because crates/tdbe/src/types/tick_generated.rs::OptionContract.symbol
is regenerated from the schema rename).

The wire format is unchanged. Contract::to_bytes / Contract::from_bytes
still serialize the field as root per Contract.java parity, and the
FLATFILES decoder still resolves both v2 (root) and v3 (symbol)
response columns through the existing decode::HEADER_ALIASES alias.

Per-language renames

Rust

  • thetadatadx::fpss::protocol::Contract:
    • .root.symbol, .exp_date.expiration
    • Contract::stock(root)Contract::stock(symbol)
    • Contract::index(root)Contract::index(symbol)
    • Contract::rate(root)Contract::rate(symbol)
    • Contract::option(root, exp_date, …)Contract::option(symbol, expiration, …)
    • Contract::option_raw(root, exp_date, …)Contract::option_raw(symbol, expiration, …)
  • tdbe::types::tick::OptionContract.rootOptionContract.symbol
  • thetadatadx::flatfiles::FlatFileRow.rootFlatFileRow.symbol

Python (thetadatadx)

  • contract.root / contract.exp_datecontract.symbol / contract.expiration
  • OptionContract(root=…) constructor keyword → OptionContract(symbol=…)

TypeScript (@thetadatadx/napi)

  • contract.root / contract.expDatecontract.symbol / contract.expiration
  • OptionContract.rootOptionContract.symbol

Go (thetadatadx)

  • c.Root / c.ExpDatec.Symbol / c.Expiration
  • OptionContract.RootOptionContract.Symbol

C++ (tdx::OptionContract, TdxContract, TdxOptionContract)

  • c.root / c.exp_date / c.has_exp_datec.symbol / c.expiration / c.has_expiration
  • OptionContract.rootOptionContract.symbol

C ABI

  • TdxContract.rootTdxContract.symbol
  • TdxContract.exp_dateTdxContract.expiration
  • TdxContract.has_exp_dateTdxContract.has_expiration
  • TdxOptionContract.rootTdxOptionContract.symbol

FLATFILES (CSV / JSONL)

  • Option / index contract-prefix headers: root,expiration,strike,right,…symbol,expiration,strike,right,…
  • Stock contract-prefix headers: root,…symbol,…
  • JSONL object keys mirror the headers ("symbol" instead of "root").

REST / WebSocket / MCP outputs

  • tools/server REST + WS JSON outputs emit "symbol" and "expiration" keys on every contract payload.
  • tools/mcp option_list_contracts rows emit "symbol" instead of "root".
  • WS subscribe envelope accepts {"contract": {"symbol": "…"}} and falls back to legacy {"root": "…"} for backwards compatibility.

SSOT touch points

  • crates/thetadatadx/tick_schema.toml: OptionContract column field renamed root → symbol.
  • crates/thetadatadx/build_support/fpss_events/{python,typescript,go_structs,ffi_rust,ffi_c}.rs: emit Contract.symbol / Contract.expiration on every binding plus the regenerated FFI converter stages a contract_symbol_cstring.
  • crates/thetadatadx/build_support/ticks/go.rs: updates the OptionContract source-expression dispatch.
  • crates/thetadatadx/build_support/ticks/rust_frames.rs + crates/thetadatadx/build_support/ticks/cli_headers.rs: Arrow / Polars / CLI raw-header column names track column.field instead of column.name, so the divergence between wire root and public symbol flows through automatically.
  • crates/thetadatadx/build_support/sdk_surface/templates/go/next_event_body.go.tmpl: reads c.symbol / c.expiration off the C ABI struct and assigns Symbol / Expiration on the Go-side *Contract.
  • crates/thetadatadx/build_support/endpoints/render/templates/cpp/option_contracts_convert.cpp.tmpl: assigns c.symbol on the C++ OptionContract value type.

Hand-written touch points

  • crates/thetadatadx/src/fpss/protocol.rsContract.symbol, Contract.expiration; constructor + method param renames; the byte-level decoder keeps the wire-spec local names (root, exp_date) so the file still diffs cleanly against the upstream binary protocol, but the struct construction now binds to the v3 names.
  • crates/thetadatadx/src/decode.rsparse_option_contracts_v3 constructs OptionContract { symbol, … }; the alias ("root", "symbol") continues to map v3 wire columns onto the find_header("root") lookup.
  • crates/thetadatadx/src/flatfiles/{decoded.rs,decoded_row.rs,index.rs,writer.rs} — symbol/expiration field renames + CSV / JSONL header rename.
  • crates/thetadatadx/src/{fpss,unified}.rs — every contract.root / contract.exp_date access updated.
  • ffi/src/{streaming.rs,types.rs}TdxOptionContract.symbol, Contract::symbol accessors.
  • tools/{cli,mcp,server} — option-contract rendering reads .symbol, REST + MCP + WS JSON outputs emit "symbol" / "expiration" keys on every contract payload.
  • sdks/cpp/include/{thetadx.h,thetadx.hpp}TdxOptionContract.symbol, OptionContract.symbol.
  • sdks/go/tick_ffi_mirrors.gocOptionContract.Symbol.
  • sdks/typescript/index.d.tsContract.symbol / Contract.expiration, OptionContract.symbol.

Regenerated bindings

  • ffi/src/{fpss_event_structs,fpss_event_converter}.rs
  • sdks/python/src/{fpss_event_classes,tick_classes,tick_arrow}.rs
  • sdks/typescript/src/{fpss_event_classes,tick_classes}.rs
  • sdks/go/{fpss_event_structs,fpss_event_structs.h.inc,fpss_methods,tick_converters,tick_structs}.go
  • sdks/cpp/include/fpss_event_structs.h.inc, sdks/cpp/src/historical.cpp.inc
  • crates/thetadatadx/src/frames_generated.rs
  • tools/cli/src/raw_headers_generated.rs

CHANGELOG / docs

  • CHANGELOG.md and docs-site/docs/changelog.md get a [8.0.27] - 2026-05-06 entry under ### Breaking with the per-language rename matrix and a ### Changed bullet noting the tdbe bump.
  • docs-site/docs/{getting-started,streaming,historical/option/list}/*.md examples updated to use contract.symbol / contract.expiration.

Test plan

Local CI gate (all green on the final push):

  • cargo fmt --all -- --check
  • cargo clippy --workspace --all-targets -- -D warnings
  • cargo test --workspace
  • cargo deny check
  • cargo run -p thetadatadx --bin generate_sdk_surfaces --features config-file -- --check
  • cargo check / clippy / test --manifest-path tools/server/Cargo.toml
  • cargo check / clippy / test --manifest-path tools/mcp/Cargo.toml
  • cargo check --manifest-path sdks/python/Cargo.toml
  • cargo check --manifest-path sdks/typescript/Cargo.toml

Closes #467

Closes #467.

Rename the public-API fields on the SDK to match the v3 vendor surface
documented in the v2 → v3 migration guide:

  Contract.root        -> Contract.symbol
  Contract.exp_date    -> Contract.expiration
  OptionContract.root  -> OptionContract.symbol
  FlatFileRow.root     -> FlatFileRow.symbol
  IndexEntry.root      -> IndexEntry.symbol
  IndexEntry.exp       -> IndexEntry.expiration

Plus the matching constructor + parameter renames (Contract::stock(symbol),
Contract::option(symbol, expiration, ...), Contract::option_raw(...),
FlatFileRow::from_decoded(symbol, expiration, ...)) and the cross-language
bindings regenerated from the SSOT (Python, TypeScript, Go, C++, C ABI).

The wire format is unchanged. Contract::to_bytes / Contract::from_bytes
still serialize the field as `root` per Contract.java parity, and the
FLATFILES decoder still resolves both v2 (`root`) and v3 (`symbol`)
response columns through the existing decode::HEADER_ALIASES alias
table.

Workspace 8.0.26 -> 8.0.27, tdbe 0.12.7 -> 0.12.8. CHANGELOG and
docs-site/docs/changelog.md kept byte-identical.

Local CI gate:

  cargo fmt --all -- --check                            # clean
  cargo clippy --workspace --all-targets -- -D warnings # clean
  cargo test --workspace                                # 0 failures
  cargo deny check                                      # advisories+bans+licenses+sources ok
  generate_sdk_surfaces --check                         # no drift
  cargo check/clippy/test --manifest-path tools/mcp/Cargo.toml
  cargo check/clippy/test --manifest-path tools/server/Cargo.toml
@userFRM userFRM force-pushed the feat/467-rename-root-symbol branch from 4725257 to e1e8a82 Compare May 6, 2026 08:53
@userFRM userFRM merged commit 3cc589a into main May 6, 2026
32 checks passed
@userFRM userFRM deleted the feat/467-rename-root-symbol branch May 6, 2026 09:21
userFRM added a commit that referenced this pull request May 7, 2026
)

Post-#484 (8.0.28) follow-up. The Rust SDK rename
Contract.root -> Contract.symbol and Contract.exp_date -> Contract.expiration
was not propagated to the doc tree. Sweep brings the docs into alignment with
the SDK surface; wire codecs (FPSS binary frames, MDDS gRPC) are unchanged.

Touched:
- docs/api-reference.md - Rust struct definitions and prose
- docs/macro-guide.md - parsed_endpoint! example query block
- docs/architecture.md - clarifies that the FPSS binary diagram labels are
  wire-format names, not SDK struct names
- docs/java-parity-checklist.md - top-of-file vocabulary note plus Rust-side
  rewrites; Java-side root/expDate references kept verbatim
- docs-site/docs/api-reference.md - field tables and prose
- docs-site/docs/streaming/{connection,events}.md - inline comments
- docs-site/docs/historical/option/list/roots.md - prose only; URL slug
  preserved for inbound-link stability
- docs-site/docs/historical/option/list/contracts.md - JSON sample, response
  table, and Go example (t.Root -> t.Symbol)
- docs-site/public/thetadatadx.yaml - OpenAPI schema for Contract
- sdks/cpp/README.md - OptionContract surface row

Version bump 8.0.33 -> 8.0.35 across all manifests; sub-Cargo.lock files
updated (8.0.34 placeholder is reserved for Wave 2A's parallel work-stream).
CHANGELOG entry added under [8.0.35] in both CHANGELOG.md and the docs-site
mirror.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(public-api): rename root → symbol and exp_date → expiration to match v3 vendor surface

1 participant